<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="MyHead">
    <script src="/resources/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="/resources/Scripts/JScriptCommon.js" type="text/javascript"></script>
    <link href="/resources/Content/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="/resources/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/resources/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <link href="/resources/Content/IndexStyle.css" rel="stylesheet" type="text/css" />
            <script src="/resources/Res/easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/resources/Res/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <link href="/resources/Res/easyui/themes/icon.css" rel="stylesheet"
        type="text/css" />
    <link href="/resources/Res/easyui/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />

    <title>

</title>
    
    <script type="text/javascript">
  
   
        $(function () {


         $("#submit").click(function () {
                if ($("productState").combobox("getValue") == "") {
                    $.messager.alert('系统提示：', '请选择产品状态！', 'warning');
                    return false;
                }
            });
        });
              

    </script>

    <script type='text/javascript'>
        function ajaxFrom(form, url) {
            progressComm();
            $.ajax({
                url: url,
                type: "Post",
                data: $(form).serialize(),
                dataType: "json",
                success: function (data) {
                    $.messager.progress('close');
                    if ($.messager) {
                        $.messager.defaults.cancel = '返回';
                        $.messager.defaults.ok = '继续';

                        $.messager.confirm('操作提示', data.msg, function (r) {
                            if (!r) {
                                window.location.href = 'javascript:history.go(-1)';
                                //alert("aaaaaaaa");
                            }
                        });
                    }

                }
            });

        }

        $(function () {
            
            $("form").submit(function (form) {
                if (form.result) {
                    ajaxFrom(this, this.action);
                }
                return false;
            });
        });
    </script>
<body>
    <div class="mbx">
        
      编辑 产品

    </div>
    <form action="edit" method="post">
    

    <fieldset>
        <legend>
            <input class="submitcss" type="submit" id="submit" value="编辑" />
            <input class="submitcss" type="button" onclick="BackList('product/product.html')" value="返回" />
        </legend>
        <div class="bigdiv">
                            
             
		<div class="editor-label">
                	产品名称
        </div>
        <div class="editor-field">
            <input class="text-box single-line" data-val="true" data-val-length="长度不可超过36" data-val-length-max="36" id="productName" name="productName" type="text" value="${product.productName}" />
        </div>
            <div class="editor-label">
                <label for="productCost">产品价格</label>
            </div>
            <div class="editor-field">
                <input class="text-box single-line" data-val="true" data-val-number="字段 产品价格必须是一个数字。" data-val-required="不能为空" id="productCost" name="productCost" type="text" value="${product.productCost}" />
                <span class="field-validation-valid" data-valmsg-for="SCL_Real" data-valmsg-replace="true"></span>
            </div>        
        
       <div class="editor-label">
                     	产品状态
            </div>
            <div class="editor-field">
            <select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="productState" name="productState" style="width:210px;">
            <option value="">请选择</option>
            <option value="启动"  <c:if test="${product.productState eq '启动'}">selected</c:if>    >启动</option>
            <option value="关闭" <c:if test="${product.productState eq '关闭'}">selected</c:if>  >关闭</option>
			</select>
            </div>
            <br style="clear: both;" />
            <input class="text-box single-line" id="productId" name="productId" type="hidden" value="${product.productId }">

        </div>
    </fieldset>

    </form>
</body>
</html>